//
//  MyLabelImageAnnotationView.m
//  cocoapodText
//
//  Created by apple on 16/9/23.
//  Copyright © 2016年 apple. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MyLabelImageAnnotationView.h"

@implementation MyLabelImageAnnotationView

@synthesize annotationImageView = _annotationImageView;
@synthesize label = _label;
@synthesize annotationLabel = _annotationLabel;

- (id)initWithAnnotation:(id<BMKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setBounds:CGRectMake(0.f, 0.f, 50.f, 30.f)];
        
        [self setBackgroundColor:[UIColor clearColor]];
        
        _annotationImageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 0, 20.f, 20.f)];
        UIImage *image = [UIImage imageNamed:@"app_map_pos.png"];
        [_annotationImageView setImage:image];
        [self addSubview:_annotationImageView];
        
        _annotationLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 20.f, 50, 10.f)];
        [_annotationLabel setText:@""];
        [_annotationLabel setBackgroundColor:[UIColor clearColor]];
        [_annotationLabel setTextColor:FUIColorFromRGB(0xff7b5c)];
        [_annotationLabel setFont:[UIFont boldSystemFontOfSize:10]];
        [_annotationLabel setTextAlignment:NSTextAlignmentCenter];
        [self addSubview:_annotationLabel];
    }
    return self;
}

-(void)setLabel:(NSString *)label{
    [_annotationLabel setText:label];
}

@end